public class test3 {
    //作业   循环结构2  第二题

    public static void main(String[] args) {
//        System.out.println(isNarcissistic(153));
        for(int i =100;i<=999;i++){
            if (isNarcissistic(i)) {
                System.out.print(i+" ");
            }
        }
    }

    private static boolean isNarcissistic(int num) {
        int sum = 0;
        int tmp = num;
        int t = 0;
        while (tmp != 0) {
            t = tmp % 10;
            sum+=Math.pow(t,3);
            tmp/=10;
        }
        return sum==num;
    }
}
